import axios from './axios'
//地图
export const getMap = (adcode: number) => {
    return axios({
        url: `https://geo.datav.aliyun.com/areas_v3/bound/geojson?code=${adcode}_full`,
        method: 'get'
    })
}
//登录
export const getlogin = (data: Object) => {
    return axios({
        url: 'http://localhost:9000/api/login',
        method: "post",
        data
    })
}
//查看
export const detaillist = (id: number) => {
    return axios({
        url: '/api/v1.0/api/student/id',
        method: 'get',
        params: {
            id
        }
    })
}
//获取学生信息
export const getlist = (data: Object) => {
    return axios({
        url: '/api/v1.0/api/student/list',
        method: 'get',
        params: { limit: 10, ...data }
    })
}
//新增
export const addlist = (data: Object) => {
    return axios({
        url: '/api/v1.0/api/student',
        method: "post",
        data
    })
}
//编辑
export const edilist = (data: Object) => {
    return axios({
        url: '/api/v1.0/api/student',
        method: 'put',
        data
    })
}
//删除
export const dellist = (id: number) => {
    return axios({
        url: '/api/v1.0/api/delete',
        method: 'delete',
        params: {
            'id[]': id
        }
    })
}
//导入
export const studenimport = (data: any) => {
    return axios({
        url: '/api/v1.0/api/import/students',
        method: 'post',
        data
    })
}

//智能检测
export const getsmart = () => {
    return axios({
        url: "/api/v1.0/api/intelligentDetection/dataitem",
        method: 'get'
    })
}
//安防管理
export const getprotection = () => {
    return axios({
        url: "/api/v1.0/api/intelligentDetection/datapp",
        method: 'get'
    })
}
//设备运维
export const getequipment = () => {
    return axios({
        url: "/api/v1.0/api/intelligentDetection/dataput"
    })
}


//mock数据设备运维
export const getprotect = () => {
    return axios({
        url: "http://localhost:9000/protect/api/list",
        method: 'get'
    })
}
//安防管理删除
export const delprotect = (stuNo: number) => {
    return axios({
        url: `http://localhost:9000/protect/api/delprotect`,
        method: 'delete',
        params: {
            stuNo: stuNo.toString()
        }
    })
}
//新增
export const addprotect = (data: Object) => {
    return axios({
        url: `http://localhost:9000/protect/api/addprotect`,
        method: 'post',
        data
    })
}
//编辑
export const editprotect = (data: Object) => {
    return axios({
        url: "http://localhost:9000/protect/api/editprotect",
        method: 'post',
        data
    })
}
//搜索
export const getsou = (stuName: string) => {
    return axios({
        url: `http://localhost:9000/protect/api/protect/sou?stuName=${stuName}`,
        method: 'get'
    })
}

//
//mock数据安防管理
export const geteuipment = () => {
    return axios({
        url: "http://localhost:9000/euipment/api/list",
        method: 'get'
    })
}
//安防管理删除
export const deleuipment = (stuNo: number) => {
    return axios({
        url: `http://localhost:9000/euipment/api/deleuipment`,
        method: 'delete',
        params: {
            stuNo: stuNo.toString()
        }
    })
}
//新增
export const addeuipment = (data: Object) => {
    return axios({
        url: `http://localhost:9000/euipment/api/addeuipment`,
        method: 'post',
        data
    })
}
//编辑
export const editeuipment = (data: Object) => {
    return axios({
        url: "http://localhost:9000/euipment/api/editeuipment",
        method: 'post',
        data
    })
}
//搜索
export const getsoueuipment = (stuName: string) => {
    return axios({
        url: `http://localhost:9000/euipment/api/euipment/sou?stuName=${stuName}`,
        method: 'get'
    })
}